#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SIZE 1028
#define NONE_FLUSH 1<<1;
#define FULL_FLUSH 1<<2;
#define LINE_FLUSH 1<<3;

typedef struct MyFile
{
  char inbuffer[SIZE];
  char outbuffer[SIZE];
  int pos;
  int end;
  int fileno;
  int cap;
  const char* flush_mode;
}MyFile;


MyFile* Myfopen(const char*filename,const char*mode);
int My_fwrite(MyFile *fp,const char*s,int size);
const char*to_modestring(int flag);
void Myfclose(const char*filename);
void Myfflush(MyFile*fp);
